/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #e8f0fe;
    color: #1a237e;
    line-height: 1.6;
    padding: 20px;
}

/* Header Styles */
header {
    background-color: #2c7be5;
    color: #e8eaf6;
    padding: 20px 0;
    border-radius: 6px;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px rgba(44, 123, 229, 0.3);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

header h1 {
    font-size: 2rem;
    margin-bottom: 10px;
}

/* Navigation Styles */
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 20px;
    align-items: center;
    padding-left: 0;
    margin: 0;
}

.nav-links a {
    color: #e8eaf6;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.3s ease;
    padding: 5px 0;
}

.nav-links a:hover {
    color: #a5c8ff;
    text-decoration: underline;
}

.welcome-text {
    color: #e8eaf6;
    font-weight: 600;
    cursor: default;
    user-select: none;
}

/* Main Content Styles */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px 30px;
    position: relative;
}

.container::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 20px;
    right: 20px;
    height: 1px;
    background-color: #c5cae9;
}

main h2 {
    margin-bottom: 20px;
    color: #2c7be5;
    font-weight: 700;
    font-size: 1.8rem;
}

.message {
    padding: 10px 15px;
    margin-bottom: 20px;
    background-color: #d4edda;
    color: #155724;
    border-radius: 4px;
    border: 1px solid #c3e6cb;
}

/* Table Styles */
table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 25px;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 5px rgba(44, 123, 229, 0.1);
}

thead tr {
    background-color: #2c7be5;
    color: #e8eaf6;
    text-align: left;
}

th, td {
    padding: 12px 15px;
    border-bottom: 1px solid #c5cae9;
    text-align: left; /* 确保文本对齐方式一致 */
}

/* 设置每个列的宽度 */
th:nth-child(1), td:nth-child(1) {
    width: 20%;
}

th:nth-child(2), td:nth-child(2) {
    width: 20%;
}

th:nth-child(3), td:nth-child(3) {
    width: 15%;
}

th:nth-child(4), td:nth-child(4) {
    width: 10%;
}

th:nth-child(5), td:nth-child(5) {
    width: 15%;
}

th:nth-child(6), td:nth-child(6) {
    width: 20%;
}

/* 鼠标悬停效果 */
tbody tr:hover {
    background-color: #d7e4fc;
}

/* Form Styles */
.add-to-cart-form {
    display: flex;
    align-items: center;
    gap: 10px; /* 添加一些间距 */
}

input[type="number"] {
    width: 60px;
    padding: 8px;
    font-size: 1rem;
    border: 1px solid #9fc1f7;
    border-radius: 4px;
    text-align: center;
    transition: border-color 0.3s ease;
}

input[type="number"]:focus {
    border-color: #2c7be5;
    outline: none;
    background: #e8f0fe;
}

/* Button Styles */
button, .btn {
    background-color: #2c7be5;
    color: #e8eaf6;
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    height: 36px;
    box-sizing: border-box;
}

button:hover:not(:disabled), .btn:hover {
    background-color: #1a57b8;
    text-decoration: none;
}

button:disabled {
    background-color: #999;
    cursor: not-allowed;
}

/* Footer Styles */
footer {
    margin-top: 40px;
    text-align: center;
    color: #555;
    font-size: 0.9rem;
    padding: 20px 0;
}

/* Utility Classes */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.no-books {
    text-align: center;
    padding: 30px;
    background: white;
    border-radius: 8px;
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.1);
}

.cart-link {
    text-align: center;
    margin-top: 20px;
}